package com.sam.demo.redis;

import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.data.redis.core.RedisTemplate;


@SpringBootApplication
public class Main {
	
	@SuppressWarnings("rawtypes")
	public static void main(String[] args) {
		ApplicationContext app = SpringApplication.run(Main.class, args);
		RedisOperation redis = app.getBean(RedisOperation.class);
		RedisTemplate redisTemplate = redis.getRedisTemplate();
		
		redisTemplate.delete("100");
		
		redisTemplate.opsForValue().set("100", "abc", 20, TimeUnit.SECONDS);
		System.out.println(redisTemplate.opsForValue().get("100"));
	}

}
